<template>
  <div id="login" class="loginbox">
    <el-form ref="loginForm" class="login-box">
      <h1 class="login-title">用户登录</h1>
      <el-form-item label="">
        <el-input
          type="text"
          autocomplete="off"
          placeholder="请输入用户名"
          v-model="form.username"
        ></el-input>
      </el-form-item>
      <el-form-item label="">
        <el-input
          type="password"
          autocomplete="off"
          placeholder="请输入密码"
          v-model="form.password"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" style="width: 100%;" @click="onSubmit">
          提交
        </el-button>
      </el-form-item>
      <el-row style="text-align: center;">
        <el-link type="primary">忘记密码</el-link>
        <el-link type="primary">用户注册</el-link>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'login',
  data() {
    return {
      form: {
        username: 'admin',
        password: 'admin',
      },
    }
  },
  methods: {
    onSubmit() {
      this.$router.push({ path: '/rpmain' })
    },
  },
}
</script>
<style lang="less" scoped>
.el-link {
  margin: auto 15px;
}
.loginbox {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  border: 1px solid #dcdfe6;
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  box-shadow: 0 0 25px #909399;
}

.login-box {
  padding: 15px;
}

.login-title {
  text-align: center;
  margin: 0 auto 40px auto;
  color: #303133;
}
</style>
